home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / 125adev.zip / MESSREAD.BAS < prev    next >
BASIC Source File  |  1993-08-08  |  2KB  |  88 lines

  1. defint a-z
  2.  
  3.     type messagetype
  4.         fromlen as string * 1
  5.         from as string * 40
  6.         tolen as string * 1
  7.         toname as string * 40
  8.         private as string * 1
  9.         datelen as string * 1
  10.         date as string * 8
  11.         timelen as string * 1
  12.         time as string * 8
  13.         thread as integer
  14.         startline as long
  15.         endline as long
  16.         aboutlen as string * 1
  17.         about as string * 50
  18.         deleted as string * 1
  19.         received as string * 1
  20.         timesread as integer
  21.         netmailsent as string * 1
  22.         netmailkill as string * 1
  23.         killafterrcv as string * 1
  24.         recvreceipt as string * 1
  25.         fileattach as string * 1
  26.         attachfiledirnumb as integer
  27.         attachname as string * 13
  28.         sendnetmail as string * 1
  29.         msnumber as long
  30.         prevmess as long
  31.         nothing as string * 61
  32.     end type
  33.  
  34.     type texttype
  35.         linelen as string * 1
  36.         linetxt as string * 127
  37.     end type
  38.  
  39. declare function pdqexist%(st$)
  40. declare function pdqvali%(st$)
  41. declare function midchar%(st$,ps%)
  42.  
  43. dim ms as messagetype
  44. dim tx as texttype
  45.  
  46. zlf$=chr$(10)
  47.  
  48. messf$="messages\1.MES"
  49. txf$="MESSAGES\1.TX"
  50.  
  51.  
  52. if not pdqexist(messf$) then end 1
  53.  
  54. print "Which Record # in message file?"
  55. line input a$
  56.  
  57. av=pdqvali%(a$)
  58.  
  59. open messf$ for random shared as 1 len=256
  60. open txf$ for random shared as 2 len=128
  61.  
  62. get #1, av, ms
  63.  
  64. close 1
  65. print "  MESSAGE NUMBER"ms.msnumber
  66. print "Message From:    "left$(ms.from,asc(ms.fromlen))
  67. print "Message To:      "left$(ms.toname,asc(ms.tolen))
  68. print "Message Subject: "left$(ms.about,asc(ms.aboutlen))
  69. print
  70.  
  71. for t&=ms.startline to ms.endline
  72.     get #2, t&, tx
  73.     stl=asc(tx.linelen)
  74.     st$=left$(tx.linetxt,stl)
  75.     lfs=0
  76.  
  77.     clf:
  78.     if midchar(st$,stl)=1 then lfs=lfs+1:stl=stl-1:st$=left$(st$,stl):goto clf
  79.     print st$
  80.     for a=1 to lfs
  81.         print zlf$;
  82.     next
  83. next
  84.  
  85. close 2
  86.  
  87. end 0
  88.